package org.xy.yq.dao.impl;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.xy.yq.dao.ICityDao;
import org.xy.yq.entity.City;

import java.util.List;

@Repository("cityDaoImpl")
public class CityDaoImpl implements ICityDao {
    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;
    @Override
    public void insertCity(City city) {
        sqlSessionTemplate.getMapper(ICityDao.class).insertCity(city);
    }

    @Override
    public List<City> getCity(String province) {
        return sqlSessionTemplate.getMapper(ICityDao.class).getCity(province);
    }

    @Override
    public List<City> top5() {
        return sqlSessionTemplate.getMapper(ICityDao.class).top5();
    }
}
